package pers.xiaojun.boot.module.system.controller.oauth2.vo;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * OAuth 2.0 访问令牌响应实体
 *
 * @author xiaojun
 * @since 2025-10-19
 */

@Schema(description = "OAuth 2.0 访问令牌响应实体-VO")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class OAuth2OpenAccessTokenRespVO {

    @Schema(
            name = "access_token",
            description = "访问令牌",
            requiredMode = Schema.RequiredMode.REQUIRED,
            example = "2a5144f95c504c8998b1aa696b7e70a1"
    )
    @JsonProperty("access_token")
    private String accessToken;


    @Schema(
            name = "refresh_token",
            description = "刷新令牌",
            example = "7b14f95c504c8998b1aa696b2a5144f9"
    )
    @JsonProperty("refresh_token")
    private String refreshToken;

    @Schema(
            name = "token_type",
            description = "令牌类型",
            requiredMode = Schema.RequiredMode.REQUIRED,
            example = "Bearer"
    )
    @JsonProperty("token_type")
    private String tokenType;

    @Schema(
            name = "expires_in",
            description = "访问令牌剩余有效期（单位：秒）",
            requiredMode = Schema.RequiredMode.REQUIRED,
            example = "7200"
    )
    @JsonProperty("expires_in")
    private Long expiresIn;

    @Schema(
            description = "授权范围（与请求时一致，如 user_public:read）",
            example = "user_public:read"
    )
    private String scope;

}